﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Color x:Key="ButtonBackgroundColor">#70FFFFCC</Color>
    <Color x:Key="ButtonBorderColor">Black</Color>
    <Color x:Key="ButtonForegroundColor">Black</Color>
    <Color x:Key="ButtonBackgroundMouseOverColor">#A0FFFFCC</Color>
    <Color x:Key="DisabledButtonBackgroundColor">#FFF2F2F2</Color>
    <Color x:Key="DisabledButtonForegroundColor">#FFBFBFBF</Color>
    <Color x:Key="ButtonPressedBackgroundColor">#E0FFFFCC</Color>
    <Color x:Key="ButtonPressedForegroundColor">#FF000000</Color>

    <Style x:Key="ButtonFocusStyle">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle Margin="2" StrokeThickness="1" Stroke="#60000000" StrokeDashArray="1 2" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Button">
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusStyle}" />
        <Setter Property="MinHeight" Value="15" />
        <Setter Property="MinWidth" Value="15" />
        <Setter Property="Foreground">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource ButtonForegroundColor}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="Border"
                            TextBlock.Foreground="{TemplateBinding Foreground}"
                            CornerRadius="0" BorderThickness="1">
                        <Border.Effect>
                            <DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0" Color="Black" />
                        </Border.Effect>
                        <Border.BorderBrush>
                            <SolidColorBrush Color="{StaticResource ButtonBorderColor}" />
                        </Border.BorderBrush>
                        <Border.Background>
                            <SolidColorBrush  Color="{StaticResource ButtonBackgroundColor}" />
                        </Border.Background>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.05" />
                                    <VisualTransition GeneratedDuration="0" To="Pressed" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard Duration="0:0:0.05">
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Border">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource ButtonBackgroundMouseOverColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Border">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource ButtonPressedBackgroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Border">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource DisabledButtonBackgroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="Border">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource DisabledButtonForegroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter Margin="3,2,3,2"
                                          HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          RecognizesAccessKey="True" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard TargetProperty="(Button.Foreground).(SolidColorBrush.Color)">
                                        <ColorAnimation To="{StaticResource ButtonPressedForegroundColor}" BeginTime="0" Duration="0" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard TargetProperty="(Button.Foreground).(SolidColorBrush.Color)">
                                        <ColorAnimation To="{StaticResource ButtonForegroundColor}" BeginTime="0" Duration="0" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>